/**
 * \license
 * Copyright Lassi Marttala 2013
 * 
 * This file is part of dlt2jpa.
 *
 * dlt2jpa is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * dlt2jpa is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with dlt2jpa.  If not, see <http://www.gnu.org/licenses/>.
 */
package net.fizzl.dlt.message;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

@Entity
public class DltMessage {
	@Id
	private long id;

	@OneToOne(cascade = CascadeType.ALL)
	@PrimaryKeyJoinColumn
	private DltStandardHeader stadardHeader;

	@OneToOne(cascade = CascadeType.ALL)
	@PrimaryKeyJoinColumn
	private DltExtendedHeader extendedHeader;
	
	@OneToOne(cascade = CascadeType.ALL)
	@PrimaryKeyJoinColumn
	private DltPayload payload;

	// Getters and setters
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public DltStandardHeader getStadardHeader() {
		return stadardHeader;
	}

	public void setStadardHeader(DltStandardHeader stadardHeader) {
		this.stadardHeader = stadardHeader;
	}

	public DltExtendedHeader getExtendedHeader() {
		return extendedHeader;
	}

	public void setExtendedHeader(DltExtendedHeader extendedHeader) {
		this.extendedHeader = extendedHeader;
	}

	public DltPayload getPayload() {
		return payload;
	}

	public void setPayload(DltPayload payload) {
		this.payload = payload;
	}
}
